<script setup>
import MyLoad from '@/components/MyLoad.vue'
import { load_state } from '@/utils/express/express.js'
import mymessage from '@/components/MyMessage.vue'
import { ref, provide } from 'vue'
import { userStore } from '@/stores/user.js'
const MyStore = userStore()
if(MyStore === 0) {
  console.log(MyStore)
}
const message = ref(false)
const message_value = ref('登录成功')
provide('change_message_state', (e) => {
  send(e)
})
const send = (e) => {
  message_value.value = e
  message.value = true
  setTimeout(() => {
    message.value = false
  }, 1500)
}
provide('isFirstLoad', true)
const FriendState = ref(true)
provide('getFriendState', (e) => {
  e ? FriendState.value = e : 1
  return FriendState.value
})

</script>

<template>
  <mymessage v-if="message">{{ message_value }}</mymessage>
  <MyLoad v-if="load_state"></MyLoad>
    <RouterView />
</template>

<style scoped lang="less"></style>
